<!--侧边功能栏-->
<ul class="nav nav-list">

    <li>
        <a href="" class="dropdown-toggle">
            <i class="menu-icon fa fa-tachometer"></i> <span class="menu-text"> 签到抽奖 </span>
            <i class="arrow fa"></i>
        </a>
        <ul class="submenu">
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="icon-double-angle-right"></i> 业主端 <b class="arrow fa"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu nav-hide" style="display: none;">
                    <li>
                        <a href="../lottery/lottery.html?type=1">
                            <i class="menu-icon fa fa-caret-right"></i> 抽奖活动管理
                        </a>
                    </li>
                    <li>
                        <a href="../lottery/lottery_log.html?type=1">
                            <i class="menu-icon fa fa-caret-right"></i> 查看日志
                        </a>
                    </li>
                    <li>
                        <a href="../lottery/lottery_analyze.html?type=1">
                            <i class="menu-icon fa fa-caret-right"></i> 统计分析
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="icon-double-angle-right"></i> 师傅端 <b class="arrow fa"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu nav-hide" style="display: none;">
                    <li>
                        <a href="../lottery/lottery.html?type=2">
                            <i class="menu-icon fa fa-caret-right"></i> 抽奖活动管理
                        </a>
                    </li>
                    <li>
                        <a href="../lottery/lottery_log.html?type=2">
                            <i class="menu-icon fa fa-caret-right"></i> 查看日志
                        </a>
                    </li>
                    <li>
                        <a href="../lottery/lottery_analyze.html?type=2">
                            <i class="menu-icon fa fa-caret-right"></i> 统计分析
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </li>

    <li class="">
        <a href="" class="dropdown-toggle">
            <i class="menu-icon fa fa-tachometer"></i> <span class="menu-text"> 营销管理 </span><i class="arrow fa"></i>
        </a>

        <ul class="submenu">
            <li>
                <a href="#" class="dropdown-toggle">
                    <i class="icon-double-angle-right"></i> 净水器 <b class="arrow fa"></b>
                </a>
                <b class="arrow"></b>

                <ul class="submenu nav-hide" style="display: none;">
                    <li>
                        <a href="../waterCleaner/setting.html">
                            <i class="menu-icon fa fa-caret-right"></i> 设置
                        </a>
                    </li>
                    <li>
                        <a href="../waterCleaner/orderManager.html">
                            <i class="menu-icon fa fa-caret-right"></i> 订单管理
                        </a>
                    </li>
                    <li>
                        <a href="../waterCleaner/incomeAndExpenses.html">
                            <i class="menu-icon fa fa-caret-right"></i> 收支明细
                        </a>
                    </li>
                    <li>
                        <a href="../waterCleaner/gatherStatistics.html">
                            <i class="menu-icon fa fa-caret-right"></i> 订单收款统计
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </li>

</ul>

<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
    <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
</div>

<script type="text/javascript">
    try {
        ace.settings.check('sidebar', 'collapsed')
    } catch (e) {
    }

    // 左边栏菜单收缩，箭头方向改变
    function menuToggleEvent(){

        var _dropDownToggleArr = $('.dropdown-toggle');// 所有 可展开的 菜单项

        for( var i=0; i < _dropDownToggleArr.length; i++ ){

            var $temp = _dropDownToggleArr.eq(i);
            if( $temp.parent('li').is('.open') ){ // 父亲<li> 展开
                $temp.children('.arrow').removeClass('fa-angle-right').addClass('fa-angle-down');
            }else{
                $temp.children('.arrow').removeClass('fa-angle-down').addClass('fa-angle-right');
            }
        }
    }

    // 自执行函数，为所有 可展开项 添加点击事件
    (function($){
        var _dropDownToggleArr = $('.dropdown-toggle');
        _dropDownToggleArr.each( function(){
            $(this).on( 'click', function(){
                // console.log('click');

                // 延迟一段时间，等到动画结束后再改变箭头方向
                setTimeout( menuToggleEvent, 100 );// 左边栏菜单收缩，箭头方向改变
            });
        })
    })( jQuery );

</script>
